package com.rollcall.wisdomroll;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.rollcall.wisdomroll.utils.StatusBarUtil;

import java.text.Format;

/**
 * Created by lenovo on 2020-12-16.
 */

public class myActivity extends Fragment{
    private Mapp mapp;
    private TextView text=null;
    private TextView jinghao=null;
    @Override
    public View onCreateView(LayoutInflater inflater , ViewGroup container, Bundle savedInstanceState){
        return inflater.inflate( R.layout.my_layout, container, false );  //要加载的layout文件
    }
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        String username = ((Mapp) getActivity().getApplication()).getUsername();
        String userno = ((Mapp) getActivity().getApplication()).getUserno();
        text = (TextView)getActivity().findViewById(R.id.username);
        text.setText(username);//赋值
        jinghao= (TextView)getActivity().findViewById(R.id.jinghao);
        jinghao.setText("警号:"+userno);//赋值


        // 添加监听
//        setOnclickByZJ();
        RelativeLayout position = (RelativeLayout) getActivity().findViewById(R.id.position);
        RelativeLayout password=(RelativeLayout) getActivity().findViewById(R.id.password);
        position.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                System.out.println("位置被点击");
                Intent intent = new Intent(getActivity(),homeActivity.class);
                startActivity(intent);

            }
        });

        password.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                System.out.println("密码被点击");
            }
        });
    }


}
